package com.code.controller;


import com.code.service.AsyncService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 开启异步注解测试
 *
 * @author wangjie
 * @version V1.0
 * @date 2020/2/22
 */
@RestController
public class AsyncController {

    Logger logger = LoggerFactory.getLogger(getClass());


    @Autowired
    AsyncService asyncService;

    @GetMapping("/async")
    public String hello(){
        asyncService.hello();
        logger.info("【异步注解测试--页面应答：success】");
        return "success";
    }
}
